In rendering graphical objects using a computer system, graphical objects are frequently rotated, scaled, and/or translated prior to being rendered. The following example is illustrative. Suppose that a computer is used to render a poster, which has a graphical image on its front surface and which is affixed to a wall in a three-dimensional space. The graphical image of the poster is defined by a bit-mapped image, i.e., a rectangular grid of pixels. A pixel is an element of the picture, i.e., of the rendering in a computer display device, of a graphical object and has a single color. When rendering in a three-dimensional projected view of the wall and therefore the poster affixed to the wall, the pixels of the graphical image of the poster are mapped to display coordinates such that the poster is rendered to appear in the projected appearance of the wall to which the poster is affixed. Rendering the poster in the three dimensional projection of the wall generally involves rotation, scaling and/or translation of the graphical image of the poster.
Such mapping typically requires substantial resources. Mapping a rotated, scaled or translated graphical image to display coordinates typically involves misaligned pixels. For example, after rotation, scaling, and/or translation, pixels of the graphical image of the poster frequently have coordinates which are not coincident in the display coordinate space with physical pixels of a computer display device in which the poster as rotated, scaled, and/or translated is displayed.
To display the graphical image of the poster, the particular color of a physical pixel of the computer display device is set according to one or more pixels of the graphical image of the poster which are near the physical pixel in the display coordinate space. In some conventional image processing systems, the color of the object pixel nearest the physical pixel is selected. As used herein, an object pixel is a pixel which defines a portion of a graphical object to be displayed. In the context of the illustrative example of the poster affixed to a wall defined in a three-dimensional space, the pixels which define the graphical image of the poster are object pixels. Mapping an object pixel to a physical pixel in this manner frequently results in undesirable effects in the rendering of a graphical object. It is usually preferred to interpolate a color between the colors of the object pixels nearest the physical pixel. Mapping an interpolated object pixel to the physical pixel and displaying as the physical pixel the color of the interpolated object pixel generally achieves a smooth, visually pleasing, desirable result.
In conventional mapping using bilinear interpolation, the proximity of a physical pixel to each of the nearest four object pixels is determined, and the weighted average of the colors of the four nearest object pixels is determined, based on the relative proximity of each of the object pixels to the physical pixel. The relative proximity of each of the object pixels to a particular physical pixel is calculated by (i) determining the distance between each of the object pixels and the physical pixel along coordinate axes, (ii) scaling the determined distances to produce respective weights for the object pixels, (iii) multiplying each component of the color of each object pixel by the respective weight of the object pixel, and (iv) summing the weighted components of the colors to form a weighted average color. Scaling each of the determined distances typically involves several arithmetic operations, requiring substantial computing resources.
For example, calculation of complementary weights for two object pixels near a physical pixel generally requires two distance calculations (each typically involving at least a substraction operation), and a separate multiplication operation for each distance calculation. These operations are required for deriving a weighted average of only two object pixels in a single dimension. Typically, a weighted average of four object pixels in two dimensions is calculated to form the color of the physical pixel. The operations required to calculate the color of the physical pixel represent a substantial component of the resources required to map a graphical image to physical pixels of a computer display device.
Because of the substantial resources required in mapping a graphical object to physical pixels, a need for ever increasingly efficient mechanisms for such mapping persists in the industry.